package com.xxx.corejava.day1203;

public class Test1 {


    public static void main(String[] args) {

        /*
            1.分配父类空间
            2.分配子类空间
            3.初始化
            4.调用勾走方法，构造方法第一行是super()，调用父类构造方法
         */
//        Bird bird=new Bird();
        Animal bird=new Bird();
//        Object bird=new Bird();

        bird.setName("b1");
        bird.setAge(2);



        bird.eat();;

        bird.move();



        if(bird instanceof Bird) {

            ((Bird)bird).setColor("红");
            ((Bird)bird).sing();
        }


        Dog dog=new Dog();

        dog.eat();;

        dog.move();
    }


}
